")[ 0 ], colors, each=jQuery.each; supportElem.style.cssText="background-color:rgba(1,1,1,.5)"; support.rgba=supportElem.style.backgroundColor.indexOf("rgba") > -1; each(spaces, function(spaceName, space){ space.cache="_" + spaceName; space.props.alpha={ idx: 3, type: "percent", def: 1 };}); function clamp(value, prop, allowEmpty){ var type=propTypes[ prop.type ]||{}; if(value==null){ return (allowEmpty||!prop.def) ? null:prop.def; } value=type.floor ? ~~value:parseFloat(value); if(isNaN(value)){ return prop.def; } if(type.mod){ return (value + type.mod) % type.mod; } return 0 > value ? 0:type.max < value ? type.max:value; } function stringParse(string){ var inst=color(), rgba=inst._rgba=[]; string=string.toLowerCase(); each(stringParsers, function(i, parser){ var parsed, match=parser.re.exec(string), values=match&&parser.parse(match), spaceName=parser.space||"rgba"; if(values){ parsed=inst[ spaceName ](values); inst[ spaces[ spaceName ].cache ]=parsed[ spaces[ spaceName ].cache ]; rgba=inst._rgba=parsed._rgba; return false; }}); if(rgba.length){ if(rgba.join()==="0,0,0,0"){ jQuery.extend(rgba, colors.transparent); } return inst; } return colors[ string ]; } color.fn=jQuery.extend(color.prototype, { parse: function(red, green, blue, alpha){ if(red===undefined){ this._rgba=[ null, null, null, null ]; return this; } if(red.jquery||red.nodeType){ red=jQuery(red).css(green); green=undefined; } var inst=this, type=jQuery.type(red), rgba=this._rgba=[]; if(green!==undefined){ red=[ red, green, blue, alpha ]; type="array"; } if(type==="string"){ return this.parse(stringParse(red)||colors._default); } if(type==="array"){ each(spaces.rgba.props, function(key, prop){ rgba[ prop.idx ]=clamp(red[ prop.idx ], prop); }); return this; } if(type==="object"){ if(red instanceof color){ each(spaces, function(spaceName, space){ if(red[ space.cache ]){ inst[ space.cache ]=red[ space.cache ].slice(); }}); }else{ each(spaces, function(spaceName, space){ var cache=space.cache; each(space.props, function(key, prop){ if(!inst[ cache ]&&space.to){ if(key==="alpha"||red[ key ]==null){ return; } inst[ cache ]=space.to(inst._rgba); } inst[ cache ][ prop.idx ]=clamp(red[ key ], prop, true); }); if(inst[ cache ]&&jQuery.inArray(null, inst[ cache ].slice(0, 3)) < 0){ inst[ cache ][ 3 ]=1; if(space.from){ inst._rgba=space.from(inst[ cache ]); }} }); } return this; }}, is: function(compare){ var is=color(compare), same=true, inst=this; each(spaces, function(_, space){ var localCache, isCache=is[ space.cache ]; if(isCache){ localCache=inst[ space.cache ]||space.to&&space.to(inst._rgba)||[]; each(space.props, function(_, prop){ if(isCache[ prop.idx ]!=null){ same=(isCache[ prop.idx ]===localCache[ prop.idx ]); return same; }}); } return same; }); return same; }, _space: function(){ var used=[], inst=this; each(spaces, function(spaceName, space){ if(inst[ space.cache ]){ used.push(spaceName); }}); return used.pop(); }, transition: function(other, distance){ var end=color(other), spaceName=end._space(), space=spaces[ spaceName ], startColor=this.alpha()===0 ? color("transparent"):this, start=startColor[ space.cache ]||space.to(startColor._rgba), result=start.slice(); end=end[ space.cache ]; each(space.props, function(key, prop){ var index=prop.idx, startValue=start[ index ], endValue=end[ index ], type=propTypes[ prop.type ]||{}; if(endValue===null){ return; } if(startValue===null){ result[ index ]=endValue; }else{ if(type.mod){ if(endValue - startValue > type.mod / 2){ startValue +=type.mod; }else if(startValue - endValue > type.mod / 2){ startValue -=type.mod; }} result[ index ]=clamp(( endValue - startValue) * distance + startValue, prop); }}); return this[ spaceName ](result); }, blend: function(opaque){ if(this._rgba[ 3 ]===1){ return this; } var rgb=this._rgba.slice(), a=rgb.pop(), blend=color(opaque)._rgba; return color(jQuery.map(rgb, function(v, i){ return(1 - a) * blend[ i ] + a * v; })); }, toRgbaString: function(){ var prefix="rgba(", rgba=jQuery.map(this._rgba, function(v, i){ return v==null ?(i > 2 ? 1:0):v; }); if(rgba[ 3 ]===1){ rgba.pop(); prefix="rgb("; } return prefix + rgba.join() + ")"; }, toHslaString: function(){ var prefix="hsla(", hsla=jQuery.map(this.hsla(), function(v, i){ if(v==null){ v=i > 2 ? 1:0; } if(i&&i < 3){ v=Math.round(v * 100) + "%"; } return v; }); if(hsla[ 3 ]===1){ hsla.pop(); prefix="hsl("; } return prefix + hsla.join() + ")"; }, toHexString: function(includeAlpha){ var rgba=this._rgba.slice(), alpha=rgba.pop(); if(includeAlpha){ rgba.push(~~(alpha * 255)); } return "#" + jQuery.map(rgba, function(v){ v=(v||0).toString(16); return v.length===1 ? "0" + v:v; }).join(""); }, toString: function(){ return this._rgba[ 3 ]===0 ? "transparent":this.toRgbaString(); }}); color.fn.parse.prototype=color.fn; function hue2rgb(p, q, h){ h=(h + 1) % 1; if(h * 6 < 1){ return p + (q - p) * h * 6; } if(h * 2 < 1){ return q; } if(h * 3 < 2){ return p + (q - p) * ((2/3) - h) * 6; } return p; } spaces.hsla.to=function(rgba){ if(rgba[ 0 ]==null||rgba[ 1 ]==null||rgba[ 2 ]==null){ return [ null, null, null, rgba[ 3 ] ]; } var r=rgba[ 0 ] / 255, g=rgba[ 1 ] / 255, b=rgba[ 2 ] / 255, a=rgba[ 3 ], max=Math.max(r, g, b), min=Math.min(r, g, b), diff=max - min, add=max + min, l=add * 0.5, h, s; if(min===max){ h=0; }else if(r===max){ h=(60 *(g - b) / diff) + 360; }else if(g===max){ h=(60 *(b - r) / diff) + 120; }else{ h=(60 *(r - g) / diff) + 240; } if(diff===0){ s=0; }else if(l <=0.5){ s=diff / add; }else{ s=diff /(2 - add); } return [ Math.round(h) % 360, s, l, a==null ? 1:a ]; }; spaces.hsla.from=function(hsla){ if(hsla[ 0 ]==null||hsla[ 1 ]==null||hsla[ 2 ]==null){ return [ null, null, null, hsla[ 3 ] ]; } var h=hsla[ 0 ] / 360, s=hsla[ 1 ], l=hsla[ 2 ], a=hsla[ 3 ], q=l <=0.5 ? l *(1 + s):l + s - l * s, p=2 * l - q; return [ Math.round(hue2rgb(p, q, h +(1 / 3)) * 255), Math.round(hue2rgb(p, q, h) * 255), Math.round(hue2rgb(p, q, h -(1 / 3)) * 255), a ]; }; each(spaces, function(spaceName, space){ var props=space.props, cache=space.cache, to=space.to, from=space.from; color.fn[ spaceName ]=function(value){ if(to&&!this[ cache ]){ this[ cache ]=to(this._rgba); } if(value===undefined){ return this[ cache ].slice(); } var ret, type=jQuery.type(value), arr=(type==="array"||type==="object") ? value:arguments, local=this[ cache ].slice(); each(props, function(key, prop){ var val=arr[ type==="object" ? key:prop.idx ]; if(val==null){ val=local[ prop.idx ]; } local[ prop.idx ]=clamp(val, prop); }); if(from){ ret=color(from(local)); ret[ cache ]=local; return ret; }else{ return color(local); }}; each(props, function(key, prop){ if(color.fn[ key ]){ return; } color.fn[ key ]=function(value){ var vtype=jQuery.type(value), fn=(key==="alpha" ?(this._hsla ? "hsla":"rgba"):spaceName), local=this[ fn ](), cur=local[ prop.idx ], match; if(vtype==="undefined"){ return cur; } if(vtype==="function"){ value=value.call(this, cur); vtype=jQuery.type(value); } if(value==null&&prop.empty){ return this; } if(vtype==="string"){ match=rplusequals.exec(value); if(match){ value=cur + parseFloat(match[ 2 ]) *(match[ 1 ]==="+" ? 1:-1); }} local[ prop.idx ]=value; return this[ fn ](local); };}); }); color.hook=function(hook){ var hooks=hook.split(" "); each(hooks, function(i, hook){ jQuery.cssHooks[ hook ]={ set: function(elem, value){ var parsed, curElem, backgroundColor=""; if(value!=="transparent"&&(jQuery.type(value)!=="string"||(parsed=stringParse(value)))){ value=color(parsed||value); if(!support.rgba&&value._rgba[ 3 ]!==1){ curElem=hook==="backgroundColor" ? elem.parentNode:elem; while ( (backgroundColor===""||backgroundColor==="transparent") && curElem&&curElem.style ){ try { backgroundColor=jQuery.css(curElem, "backgroundColor"); curElem=curElem.parentNode; } catch(e){ }} value=value.blend(backgroundColor&&backgroundColor!=="transparent" ? backgroundColor : "_default"); } value=value.toRgbaString(); } try { elem.style[ hook ]=value; } catch(e){ }} }; jQuery.fx.step[ hook ]=function(fx){ if(!fx.colorInit){ fx.start=color(fx.elem, hook); fx.end=color(fx.end); fx.colorInit=true; } jQuery.cssHooks[ hook ].set(fx.elem, fx.start.transition(fx.end, fx.pos)); };}); }; color.hook(stepHooks); jQuery.cssHooks.borderColor={ expand: function(value){ var expanded={}; each([ "Top", "Right", "Bottom", "Left" ], function(i, part){ expanded[ "border" + part + "Color" ]=value; }); return expanded; }}; colors=jQuery.Color.names={ aqua: "#00ffff", black: "#000000", blue: "#0000ff", fuchsia: "#ff00ff", gray: "#808080", green: "#008000", lime: "#00ff00", maroon: "#800000", navy: "#000080", olive: "#808000", purple: "#800080", red: "#ff0000", silver: "#c0c0c0", teal: "#008080", white: "#ffffff", yellow: "#ffff00", transparent: [ null, null, null, 0 ], _default: "#ffffff" };})(jQuery); (function(){ var classAnimationActions=[ "add", "remove", "toggle" ], shorthandStyles={ border: 1, borderBottom: 1, borderColor: 1, borderLeft: 1, borderRight: 1, borderTop: 1, borderWidth: 1, margin: 1, padding: 1 }; $.each([ "borderLeftStyle", "borderRightStyle", "borderBottomStyle", "borderTopStyle" ], function(_, prop){ $.fx.step[ prop ]=function(fx){ if(fx.end!=="none"&&!fx.setAttr||fx.pos===1&&!fx.setAttr){ jQuery.style(fx.elem, prop, fx.end); fx.setAttr=true; }};}); function getElementStyles(elem){ var key, len, style=elem.ownerDocument.defaultView ? elem.ownerDocument.defaultView.getComputedStyle(elem, null) : elem.currentStyle, styles={}; if(style&&style.length&&style[ 0 ]&&style[ style[ 0 ] ]){ len=style.length; while(len--){ key=style[ len ]; if(typeof style[ key ]==="string"){ styles[ $.camelCase(key) ]=style[ key ]; }} }else{ for(key in style){ if(typeof style[ key ]==="string"){ styles[ key ]=style[ key ]; }} } return styles; } function styleDifference(oldStyle, newStyle){ var diff={}, name, value; for(name in newStyle){ value=newStyle[ name ]; if(oldStyle[ name ]!==value){ if(!shorthandStyles[ name ]){ if($.fx.step[ name ]||!isNaN(parseFloat(value))){ diff[ name ]=value; }} }} return diff; } if(!$.fn.addBack){ $.fn.addBack=function(selector){ return this.add(selector==null ? this.prevObject:this.prevObject.filter(selector) ); };} $.effects.animateClass=function(value, duration, easing, callback){ var o=$.speed(duration, easing, callback); return this.queue(function(){ var animated=$(this), baseClass=animated.attr("class")||"", applyClassChange, allAnimations=o.children ? animated.find("*").addBack():animated; allAnimations=allAnimations.map(function(){ var el=$(this); return { el: el, start: getElementStyles(this) };}); applyClassChange=function(){ $.each(classAnimationActions, function(i, action){ if(value[ action ]){ animated[ action + "Class" ](value[ action ]); }}); }; applyClassChange(); allAnimations=allAnimations.map(function(){ this.end=getElementStyles(this.el[ 0 ]); this.diff=styleDifference(this.start, this.end); return this; }); animated.attr("class", baseClass); allAnimations=allAnimations.map(function(){ var styleInfo=this, dfd=$.Deferred(), opts=$.extend({}, o, { queue: false, complete: function(){ dfd.resolve(styleInfo); }}); this.el.animate(this.diff, opts); return dfd.promise(); }); $.when.apply($, allAnimations.get()).done(function(){ applyClassChange(); $.each(arguments, function(){ var el=this.el; $.each(this.diff, function(key){ el.css(key, ""); }); }); o.complete.call(animated[ 0 ]); }); }); }; $.fn.extend({ addClass: (function(orig){ return function(classNames, speed, easing, callback){ return speed ? $.effects.animateClass.call(this, { add: classNames }, speed, easing, callback) : orig.apply(this, arguments); };})($.fn.addClass), removeClass: (function(orig){ return function(classNames, speed, easing, callback){ return arguments.length > 1 ? $.effects.animateClass.call(this, { remove: classNames }, speed, easing, callback) : orig.apply(this, arguments); };})($.fn.removeClass), toggleClass: (function(orig){ return function(classNames, force, speed, easing, callback){ if(typeof force==="boolean"||force===undefined){ if(!speed){ return orig.apply(this, arguments); }else{ return $.effects.animateClass.call(this, (force ? { add: classNames }:{ remove: classNames }), speed, easing, callback); }}else{ return $.effects.animateClass.call(this, { toggle: classNames }, force, speed, easing); }};})($.fn.toggleClass), switchClass: function(remove, add, speed, easing, callback){ return $.effects.animateClass.call(this, { add: add, remove: remove }, speed, easing, callback); }}); })(); (function(){ $.extend($.effects, { version: "1.10.3", save: function(element, set){ for(var i=0; i < set.length; i++){ if(set[ i ]!==null){ element.data(dataSpace + set[ i ], element[ 0 ].style[ set[ i ] ]); }} }, restore: function(element, set){ var val, i; for(i=0; i < set.length; i++){ if(set[ i ]!==null){ val=element.data(dataSpace + set[ i ]); if(val===undefined){ val=""; } element.css(set[ i ], val); }} }, setMode: function(el, mode){ if(mode==="toggle"){ mode=el.is(":hidden") ? "show":"hide"; } return mode; }, getBaseline: function(origin, original){ var y, x; switch(origin[ 0 ]){ case "top": y=0; break; case "middle": y=0.5; break; case "bottom": y=1; break; default: y=origin[ 0 ] / original.height; } switch(origin[ 1 ]){ case "left": x=0; break; case "center": x=0.5; break; case "right": x=1; break; default: x=origin[ 1 ] / original.width; } return { x: x, y: y };}, createWrapper: function(element){ if(element.parent().is(".ui-effects-wrapper")){ return element.parent(); } var props={ width: element.outerWidth(true), height: element.outerHeight(true), "float": element.css("float") }, wrapper=$("
") .addClass("ui-effects-wrapper") .css({ fontSize: "100%", background: "transparent", border: "none", margin: 0, padding: 0 }), size={ width: element.width(), height: element.height() }, active=document.activeElement; try { active.id; } catch(e){ active=document.body; } element.wrap(wrapper); if(element[ 0 ]===active||$.contains(element[ 0 ], active)){ $(active).focus(); } wrapper=element.parent(); if(element.css("position")==="static"){ wrapper.css({ position: "relative" }); element.css({ position: "relative" }); }else{ $.extend(props, { position: element.css("position"), zIndex: element.css("z-index") }); $.each([ "top", "left", "bottom", "right" ], function(i, pos){ props[ pos ]=element.css(pos); if(isNaN(parseInt(props[ pos ], 10))){ props[ pos ]="auto"; }}); element.css({ position: "relative", top: 0, left: 0, right: "auto", bottom: "auto" }); } element.css(size); return wrapper.css(props).show(); }, removeWrapper: function(element){ var active=document.activeElement; if(element.parent().is(".ui-effects-wrapper")){ element.parent().replaceWith(element); if(element[ 0 ]===active||$.contains(element[ 0 ], active)){ $(active).focus(); }} return element; }, setTransition: function(element, list, factor, value){ value=value||{}; $.each(list, function(i, x){ var unit=element.cssUnit(x); if(unit[ 0 ] > 0){ value[ x ]=unit[ 0 ] * factor + unit[ 1 ]; }}); return value; }}); function _normalizeArguments(effect, options, speed, callback){ if($.isPlainObject(effect)){ options=effect; effect=effect.effect; } effect={ effect: effect }; if(options==null){ options={};} if($.isFunction(options)){ callback=options; speed=null; options={};} if(typeof options==="number"||$.fx.speeds[ options ]){ callback=speed; speed=options; options={};} if($.isFunction(speed)){ callback=speed; speed=null; } if(options){ $.extend(effect, options); } speed=speed||options.duration; effect.duration=$.fx.off ? 0 : typeof speed==="number" ? speed : speed in $.fx.speeds ? $.fx.speeds[ speed ] : $.fx.speeds._default; effect.complete=callback||options.complete; return effect; } function standardAnimationOption(option){ if(!option||typeof option==="number"||$.fx.speeds[ option ]){ return true; } if(typeof option==="string"&&!$.effects.effect[ option ]){ return true; } if($.isFunction(option)){ return true; } if(typeof option==="object"&&!option.effect){ return true; } return false; } $.fn.extend({ effect: function(){ var args=_normalizeArguments.apply(this, arguments), mode=args.mode, queue=args.queue, effectMethod=$.effects.effect[ args.effect ]; if($.fx.off||!effectMethod){ if(mode){ return this[ mode ](args.duration, args.complete); }else{ return this.each(function(){ if(args.complete){ args.complete.call(this); }}); }} function run(next){ var elem=$(this), complete=args.complete, mode=args.mode; function done(){ if($.isFunction(complete)){ complete.call(elem[0]); } if($.isFunction(next)){ next(); }} if(elem.is(":hidden") ? mode==="hide":mode==="show"){ elem[ mode ](); done(); }else{ effectMethod.call(elem[0], args, done); }} return queue===false ? this.each(run):this.queue(queue||"fx", run); }, show: (function(orig){ return function(option){ if(standardAnimationOption(option)){ return orig.apply(this, arguments); }else{ var args=_normalizeArguments.apply(this, arguments); args.mode="show"; return this.effect.call(this, args); }};})($.fn.show), hide: (function(orig){ return function(option){ if(standardAnimationOption(option)){ return orig.apply(this, arguments); }else{ var args=_normalizeArguments.apply(this, arguments); args.mode="hide"; return this.effect.call(this, args); }};})($.fn.hide), toggle: (function(orig){ return function(option){ if(standardAnimationOption(option)||typeof option==="boolean"){ return orig.apply(this, arguments); }else{ var args=_normalizeArguments.apply(this, arguments); args.mode="toggle"; return this.effect.call(this, args); }};})($.fn.toggle), cssUnit: function(key){ var style=this.css(key), val=[]; $.each([ "em", "px", "%", "pt" ], function(i, unit){ if(style.indexOf(unit) > 0){ val=[ parseFloat(style), unit ]; }}); return val; }}); })(); (function(){ var baseEasings={}; $.each([ "Quad", "Cubic", "Quart", "Quint", "Expo" ], function(i, name){ baseEasings[ name ]=function(p){ return Math.pow(p, i + 2); };}); $.extend(baseEasings, { Sine: function(p){ return 1 - Math.cos(p * Math.PI / 2); }, Circ: function(p){ return 1 - Math.sqrt(1 - p * p); }, Elastic: function(p){ return p===0||p===1 ? p : -Math.pow(2, 8 * (p - 1)) * Math.sin(( (p - 1) * 80 - 7.5) * Math.PI / 15); }, Back: function(p){ return p * p *(3 * p - 2); }, Bounce: function(p){ var pow2, bounce=4; while(p <(( pow2=Math.pow(2, --bounce)) - 1) / 11){} return 1 / Math.pow(4, 3 - bounce) - 7.5625 * Math.pow(( pow2 * 3 - 2) / 22 - p, 2); }}); $.each(baseEasings, function(name, easeIn){ $.easing[ "easeIn" + name ]=easeIn; $.easing[ "easeOut" + name ]=function(p){ return 1 - easeIn(1 - p); }; $.easing[ "easeInOut" + name ]=function(p){ return p < 0.5 ? easeIn(p * 2) / 2 : 1 - easeIn(p * -2 + 2) / 2; };}); })(); })(jQuery); (function($, undefined){ var uid=0, hideProps={}, showProps={}; hideProps.height=hideProps.paddingTop=hideProps.paddingBottom = hideProps.borderTopWidth=hideProps.borderBottomWidth="hide"; showProps.height=showProps.paddingTop=showProps.paddingBottom = showProps.borderTopWidth=showProps.borderBottomWidth="show"; $.widget("ui.accordion", { version: "1.10.3", options: { active: 0, animate: {}, collapsible: false, event: "click", header: "> li > :first-child,> :not(li):even", heightStyle: "auto", icons: { activeHeader: "ui-icon-triangle-1-s", header: "ui-icon-triangle-1-e" }, activate: null, beforeActivate: null }, _create: function(){ var options=this.options; this.prevShow=this.prevHide=$(); this.element.addClass("ui-accordion ui-widget ui-helper-reset") .attr("role", "tablist"); if(!options.collapsible&&(options.active===false||options.active==null)){ options.active=0; } this._processPanels(); if(options.active < 0){ options.active +=this.headers.length; } this._refresh(); }, _getCreateEventData: function(){ return { header: this.active, panel: !this.active.length ? $():this.active.next(), content: !this.active.length ? $():this.active.next() };}, _createIcons: function(){ var icons=this.options.icons; if(icons){ $("") .addClass("ui-accordion-header-icon ui-icon " + icons.header) .prependTo(this.headers); this.active.children(".ui-accordion-header-icon") .removeClass(icons.header) .addClass(icons.activeHeader); this.headers.addClass("ui-accordion-icons"); }}, _destroyIcons: function(){ this.headers .removeClass("ui-accordion-icons") .children(".ui-accordion-header-icon") .remove(); }, _destroy: function(){ var contents; this.element .removeClass("ui-accordion ui-widget ui-helper-reset") .removeAttr("role"); this.headers .removeClass("ui-accordion-header ui-accordion-header-active ui-helper-reset ui-state-default ui-corner-all ui-state-active ui-state-disabled ui-corner-top") .removeAttr("role") .removeAttr("aria-selected") .removeAttr("aria-controls") .removeAttr("tabIndex") .each(function(){ if(/^ui-accordion/.test(this.id)){ this.removeAttribute("id"); }}); this._destroyIcons(); contents=this.headers.next() .css("display", "") .removeAttr("role") .removeAttr("aria-expanded") .removeAttr("aria-hidden") .removeAttr("aria-labelledby") .removeClass("ui-helper-reset ui-widget-content ui-corner-bottom ui-accordion-content ui-accordion-content-active ui-state-disabled") .each(function(){ if(/^ui-accordion/.test(this.id)){ this.removeAttribute("id"); }}); if(this.options.heightStyle!=="content"){ contents.css("height", ""); }}, _setOption: function(key, value){ if(key==="active"){ this._activate(value); return; } if(key==="event"){ if(this.options.event){ this._off(this.headers, this.options.event); } this._setupEvents(value); } this._super(key, value); if(key==="collapsible"&&!value&&this.options.active===false){ this._activate(0); } if(key==="icons"){ this._destroyIcons(); if(value){ this._createIcons(); }} if(key==="disabled"){ this.headers.add(this.headers.next()) .toggleClass("ui-state-disabled", !!value); }}, _keydown: function(event){ if(event.altKey||event.ctrlKey){ return; } var keyCode=$.ui.keyCode, length=this.headers.length, currentIndex=this.headers.index(event.target), toFocus=false; switch(event.keyCode){ case keyCode.RIGHT: case keyCode.DOWN: toFocus=this.headers[(currentIndex + 1) % length ]; break; case keyCode.LEFT: case keyCode.UP: toFocus=this.headers[(currentIndex - 1 + length) % length ]; break; case keyCode.SPACE: case keyCode.ENTER: this._eventHandler(event); break; case keyCode.HOME: toFocus=this.headers[ 0 ]; break; case keyCode.END: toFocus=this.headers[ length - 1 ]; break; } if(toFocus){ $(event.target).attr("tabIndex", -1); $(toFocus).attr("tabIndex", 0); toFocus.focus(); event.preventDefault(); }}, _panelKeyDown:function(event){ if(event.keyCode===$.ui.keyCode.UP&&event.ctrlKey){ $(event.currentTarget).prev().focus(); }}, refresh: function(){ var options=this.options; this._processPanels(); if(( options.active===false&&options.collapsible===true)||!this.headers.length){ options.active=false; this.active=$(); }else if(options.active===false){ this._activate(0); }else if(this.active.length&&!$.contains(this.element[ 0 ], this.active[ 0 ])){ if(this.headers.length===this.headers.find(".ui-state-disabled").length){ options.active=false; this.active=$(); }else{ this._activate(Math.max(0, options.active - 1)); }}else{ options.active=this.headers.index(this.active); } this._destroyIcons(); this._refresh(); }, _processPanels: function(){ this.headers=this.element.find(this.options.header) .addClass("ui-accordion-header ui-helper-reset ui-state-default ui-corner-all"); this.headers.next() .addClass("ui-accordion-content ui-helper-reset ui-widget-content ui-corner-bottom") .filter(":not(.ui-accordion-content-active)") .hide(); }, _refresh: function(){ var maxHeight, options=this.options, heightStyle=options.heightStyle, parent=this.element.parent(), accordionId=this.accordionId="ui-accordion-" + (this.element.attr("id")||++uid); this.active=this._findActive(options.active) .addClass("ui-accordion-header-active ui-state-active ui-corner-top") .removeClass("ui-corner-all"); this.active.next() .addClass("ui-accordion-content-active") .show(); this.headers .attr("role", "tab") .each(function(i){ var header=$(this), headerId=header.attr("id"), panel=header.next(), panelId=panel.attr("id"); if(!headerId){ headerId=accordionId + "-header-" + i; header.attr("id", headerId); } if(!panelId){ panelId=accordionId + "-panel-" + i; panel.attr("id", panelId); } header.attr("aria-controls", panelId); panel.attr("aria-labelledby", headerId); }) .next() .attr("role", "tabpanel"); this.headers .not(this.active) .attr({ "aria-selected": "false", tabIndex: -1 }) .next() .attr({ "aria-expanded": "false", "aria-hidden": "true" }) .hide(); if(!this.active.length){ this.headers.eq(0).attr("tabIndex", 0); }else{ this.active.attr({ "aria-selected": "true", tabIndex: 0 }) .next() .attr({ "aria-expanded": "true", "aria-hidden": "false" }); } this._createIcons(); this._setupEvents(options.event); if(heightStyle==="fill"){ maxHeight=parent.height(); this.element.siblings(":visible").each(function(){ var elem=$(this), position=elem.css("position"); if(position==="absolute"||position==="fixed"){ return; } maxHeight -=elem.outerHeight(true); }); this.headers.each(function(){ maxHeight -=$(this).outerHeight(true); }); this.headers.next() .each(function(){ $(this).height(Math.max(0, maxHeight - $(this).innerHeight() + $(this).height())); }) .css("overflow", "auto"); }else if(heightStyle==="auto"){ maxHeight=0; this.headers.next() .each(function(){ maxHeight=Math.max(maxHeight, $(this).css("height", "").height()); }) .height(maxHeight); }}, _activate: function(index){ var active=this._findActive(index)[ 0 ]; if(active===this.active[ 0 ]){ return; } active=active||this.active[ 0 ]; this._eventHandler({ target: active, currentTarget: active, preventDefault: $.noop }); }, _findActive: function(selector){ return typeof selector==="number" ? this.headers.eq(selector):$(); }, _setupEvents: function(event){ var events={ keydown: "_keydown" }; if(event){ $.each(event.split(" "), function(index, eventName){ events[ eventName ]="_eventHandler"; }); } this._off(this.headers.add(this.headers.next())); this._on(this.headers, events); this._on(this.headers.next(), { keydown: "_panelKeyDown" }); this._hoverable(this.headers); this._focusable(this.headers); }, _eventHandler: function(event){ var options=this.options, active=this.active, clicked=$(event.currentTarget), clickedIsActive=clicked[ 0 ]===active[ 0 ], collapsing=clickedIsActive&&options.collapsible, toShow=collapsing ? $():clicked.next(), toHide=active.next(), eventData={ oldHeader: active, oldPanel: toHide, newHeader: collapsing ? $():clicked, newPanel: toShow }; event.preventDefault(); if((clickedIsActive&&!options.collapsible) || (this._trigger("beforeActivate", event, eventData)===false)){ return; } options.active=collapsing ? false:this.headers.index(clicked); this.active=clickedIsActive ? $():clicked; this._toggle(eventData); active.removeClass("ui-accordion-header-active ui-state-active"); if(options.icons){ active.children(".ui-accordion-header-icon") .removeClass(options.icons.activeHeader) .addClass(options.icons.header); } if(!clickedIsActive){ clicked .removeClass("ui-corner-all") .addClass("ui-accordion-header-active ui-state-active ui-corner-top"); if(options.icons){ clicked.children(".ui-accordion-header-icon") .removeClass(options.icons.header) .addClass(options.icons.activeHeader); } clicked .next() .addClass("ui-accordion-content-active"); }}, _toggle: function(data){ var toShow=data.newPanel, toHide=this.prevShow.length ? this.prevShow:data.oldPanel; this.prevShow.add(this.prevHide).stop(true, true); this.prevShow=toShow; this.prevHide=toHide; if(this.options.animate){ this._animate(toShow, toHide, data); }else{ toHide.hide(); toShow.show(); this._toggleComplete(data); } toHide.attr({ "aria-expanded": "false", "aria-hidden": "true" }); toHide.prev().attr("aria-selected", "false"); if(toShow.length&&toHide.length){ toHide.prev().attr("tabIndex", -1); }else if(toShow.length){ this.headers.filter(function(){ return $(this).attr("tabIndex")===0; }) .attr("tabIndex", -1); } toShow .attr({ "aria-expanded": "true", "aria-hidden": "false" }) .prev() .attr({ "aria-selected": "true", tabIndex: 0 }); }, _animate: function(toShow, toHide, data){ var total, easing, duration, that=this, adjust=0, down=toShow.length && (!toHide.length||(toShow.index() < toHide.index())), animate=this.options.animate||{}, options=down&&animate.down||animate, complete=function(){ that._toggleComplete(data); }; if(typeof options==="number"){ duration=options; } if(typeof options==="string"){ easing=options; } easing=easing||options.easing||animate.easing; duration=duration||options.duration||animate.duration; if(!toHide.length){ return toShow.animate(showProps, duration, easing, complete); } if(!toShow.length){ return toHide.animate(hideProps, duration, easing, complete); } total=toShow.show().outerHeight(); toHide.animate(hideProps, { duration: duration, easing: easing, step: function(now, fx){ fx.now=Math.round(now); }}); toShow .hide() .animate(showProps, { duration: duration, easing: easing, complete: complete, step: function(now, fx){ fx.now=Math.round(now); if(fx.prop!=="height"){ adjust +=fx.now; }else if(that.options.heightStyle!=="content"){ fx.now=Math.round(total - toHide.outerHeight() - adjust); adjust=0; }} }); }, _toggleComplete: function(data){ var toHide=data.oldPanel; toHide .removeClass("ui-accordion-content-active") .prev() .removeClass("ui-corner-top") .addClass("ui-corner-all"); if(toHide.length){ toHide.parent()[0].className=toHide.parent()[0].className; } this._trigger("activate", null, data); }}); })(jQuery); (function($, undefined){ var requestIndex=0; $.widget("ui.autocomplete", { version: "1.10.3", defaultElement: "", options: { appendTo: null, autoFocus: false, delay: 300, minLength: 1, position: { my: "left top", at: "left bottom", collision: "none" }, source: null, change: null, close: null, focus: null, open: null, response: null, search: null, select: null }, pending: 0, _create: function(){ var suppressKeyPress, suppressKeyPressRepeat, suppressInput, nodeName=this.element[0].nodeName.toLowerCase(), isTextarea=nodeName==="textarea", isInput=nodeName==="input"; this.isMultiLine = isTextarea ? true : isInput ? false : this.element.prop("isContentEditable"); this.valueMethod=this.element[ isTextarea||isInput ? "val":"text" ]; this.isNewMenu=true; this.element .addClass("ui-autocomplete-input") .attr("autocomplete", "off"); this._on(this.element, { keydown: function(event){ if(this.element.prop("readOnly")){ suppressKeyPress=true; suppressInput=true; suppressKeyPressRepeat=true; return; } suppressKeyPress=false; suppressInput=false; suppressKeyPressRepeat=false; var keyCode=$.ui.keyCode; switch(event.keyCode){ case keyCode.PAGE_UP: suppressKeyPress=true; this._move("previousPage", event); break; case keyCode.PAGE_DOWN: suppressKeyPress=true; this._move("nextPage", event); break; case keyCode.UP: suppressKeyPress=true; this._keyEvent("previous", event); break; case keyCode.DOWN: suppressKeyPress=true; this._keyEvent("next", event); break; case keyCode.ENTER: case keyCode.NUMPAD_ENTER: if(this.menu.active){ suppressKeyPress=true; event.preventDefault(); this.menu.select(event); } break; case keyCode.TAB: if(this.menu.active){ this.menu.select(event); } break; case keyCode.ESCAPE: if(this.menu.element.is(":visible")){ this._value(this.term); this.close(event); event.preventDefault(); } break; default: suppressKeyPressRepeat=true; this._searchTimeout(event); break; }}, keypress: function(event){ if(suppressKeyPress){ suppressKeyPress=false; if(!this.isMultiLine||this.menu.element.is(":visible")){ event.preventDefault(); } return; } if(suppressKeyPressRepeat){ return; } var keyCode=$.ui.keyCode; switch(event.keyCode){ case keyCode.PAGE_UP: this._move("previousPage", event); break; case keyCode.PAGE_DOWN: this._move("nextPage", event); break; case keyCode.UP: this._keyEvent("previous", event); break; case keyCode.DOWN: this._keyEvent("next", event); break; }}, input: function(event){ if(suppressInput){ suppressInput=false; event.preventDefault(); return; } this._searchTimeout(event); }, focus: function(){ this.selectedItem=null; this.previous=this._value(); }, blur: function(event){ if(this.cancelBlur){ delete this.cancelBlur; return; } clearTimeout(this.searching); this.close(event); this._change(event); }}); this._initSource(); this.menu=$("